package chapter01.d04;
/**
 * suspend、resume使用案例
 * @author kenneth
 *
 */
public class ThreadSuspend {
	public static void main(String[] args) {
	     Thread mt = new MyThread();
	     mt.start();
	     mt.suspend();
	     try {
	          Thread.currentThread().sleep(1000);
	          System.out.println("唤醒mt线程");
	 	      mt.resume();
	     } catch(InterruptedException e) {
	          e.printStackTrace();
	     }
	     
	}
	 
	static class MyThread extends Thread {
	     public void run() {
	          while (true) {
	        	  try {
					Thread.sleep(1000);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
	              System.out.println("running....");
	          }
	     }
	}
}
